home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / pyshared / computerjanitor / __init__.py next >
Encoding:
Python Source  |  2009-04-27  |  1.7 KB  |  56 lines

  1. # __init__.py for computerjanitor
  2. # Copyright (C) 2008  Canonical, Ltd.
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, version 3 of the License.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15.  
  16.  
  17. VERSION = "1.11"
  18.  
  19.  
  20. # Set up gettext. This needs to be before the import statements below
  21. # so that if any modules call it right after importing, they find
  22. # setup_gettext.
  23.  
  24. def setup_gettext():
  25.     """Set up gettext for a module.
  26.  
  27.     Return a method to be used for looking up translations. Usage:
  28.  
  29.       import computerjanitor
  30.       _ = computerjanitor.setup_gettext()
  31.  
  32.     """
  33.  
  34.     import gettext
  35.     import os
  36.  
  37.     domain = 'update-manager'
  38.     localedir = os.environ.get('LOCPATH', None)
  39.     t = gettext.translation(domain, localedir=localedir, fallback=True)
  40.     return t.ugettext
  41.  
  42.  
  43. from cruft import Cruft
  44. from file_cruft import FileCruft
  45. from package_cruft import PackageCruft
  46. from missing_package_cruft import MissingPackageCruft
  47. from exc import ComputerJanitorException as Exception, UnimplementedMethod
  48. from plugin import Plugin, PluginManager
  49.  
  50.  
  51. # The following is a kludge to silence python-apt's warning about
  52. # the API being unstable.
  53. import warnings
  54. warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
  55. import apt
  56.